Fog effects are an important part of realistic simulation environments. As an example, flight simulators often use fog effects to simulate adverse weather conditions. This allows air crews to be safely familiarized with difficult operational scenarios, such as landing on fog-obscured runways. To be realistic, fog effects must closely model the appearance and behavior of real fog conditions. This means that fog effects must be capable of modeling patchy or otherwise non-uniform fog or haze. Realistic fog effects must also be capable of animation. This allows fog to swirl or move in a manner that mimics natural fog.
Computer systems (and related devices) typically create three-dimensional images using a sequence of stages known as a graphics pipeline. During early pipeline stages, images are modeled using a mosaic-like approach where each image is composed of a collection of individual points, lines and polygons. These points, lines and polygons are know as primitives and a single image may require thousands, or even millions, of primitives.
In the past, several techniques have been developed which can be used within the stages of a graphics pipeline to create fog effects. These techniques include color blending, texture mapping and volumetric rendering.
For color blending, a fog color is selected or defined. During the fogging process, the graphics pipeline blends the fog color into each of the pixels within the image being fogged. The graphics pipeline determines the amount of fog color to add to the image's pixels by calculating a weighting factor for each pixel. Each pixel's weighting factor is a linear or exponential function of the distance between the pixel and the eye-point. The graphics pipeline blends the predefined fog color into the each pixel in accordance with the pixel's weighting factor.
For texture mapping, a series of texture maps are generated. Each texture map is configured to make objects appear as if they are being viewed through a specific fog depth. Thus, a first texture map might make objects appear as if they were obscured by one meter of fog and a second texture map might make objects appear as if they were obscured by ten meters of fog. In some cases, the series of textures are encoded within a three-dimensional texture map. During the fogging process, the graphics pipeline selects the appropriate texture map for each primitive within the image being fogged. The selection of texture maps is based on the distance between the primitives and the eye-point. The pipeline then textures each primitive with the appropriate texture map.
For volumetric rendering, a three-dimensional volume is generated to model the desired fog effect. During the fogging process, the graphics pipeline applies the three-dimensional volume to the space between the primitives included in an image and the eye-point. Typically, this is accomplished through the use of a volumetric rendering technique such as ray-casting, voxel rendering, or three-dimensional texture-slice composition.
Color blending, texture mapping and volumetric rendering are all effective techniques for rendering uniform fog effects. Unfortunately, each of these techniques are subject to disadvantages that make them less than optimal for flight simulators and other simulation environments. For example, when color blending is used to create fog effects, the amount of fog color is controlled strictly by pixel distance. The means that fog effects produced by these techniques tend to be uniform (non-patchy) and constant over time (inanimate). Texture mapping and volumetric rendering each allow for the creation of non-uniform (patchy) fog effects. For this reason both of these techniques offer a higher degree of realism than is possible for color blending. Unfortunately, neither texture mapping nor volumetric rendering provide animated fog effects. Both of these techniques are also limited in other fashions. Texture mapping, for example, fails to provide a mechanism that allows the appearance of a fog effect to change as the eye-point moves in relation to an image. Volumetric rendering overcomes this difficulty but generally requires expensive hardware support within the graphics processor.
Thus, a need exists for a method for rendering fog effects that provides non-uniform, animated fog effects. The fog effects created must be accurately portrayed as the position of the eye-point changes within an image. These methods need to provide high-performance graphics throughput and be relatively inexpensive to implement. This need is especially important for simulation environments, such as flight simulators and for highly realistic virtual reality systems.